/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: CoffeeMachine
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2022/1/10 16:33
 * @version: 1.0
 */
public class CoffeeMachine extends Colleague{


    /**构造函数*/
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        mediator.Register(name,this);
    }

    @Override
    public void SendMessage(int stateChange) {
        this.getMediator().GetMessage(stateChange,this.name);
    }

    public void StartCoffee(){
        System.out.println("It's time to startCoffee!");
    }

    public void FinishCoffee(){
        System.out.println("After 5 minutes!");
        System.out.println("Coffee is ok!!");
        SendMessage(0);
    }
}
